import { ADD_PERSON } from '../constant'
const initPersons = [
    { id: '001', name: "陶贼帅", age: 30 }
]


export default function personReducer( preState = initPersons, action ){
    const { type, data } = action
    switch (type) {
        case ADD_PERSON:
            return [ data, ...preState ]
    
        default:
            return preState
    }
}